import request from '@/utils/request'

// 获得所有博士后需求管理分页
export function getDemandList(params?: any) {
  return request({
    url: '/project/postdoc/demand/page',
    method: 'GET',
    params,
  })
}
// 获得我提交的博士后需求管理分页  列表字段缺少，项目名称
export function getDemandMyPageList(params?: any) {
  return request({
    url: '/project/postdoc/demand/my-page',
    method: 'GET',
    params,
  })
}
// 获得博士后需求管理
export function getDemandInfo(params?: any) {
  return request({
    url: '/project/postdoc/demand/get',
    method: 'GET',
    params,
  })
}

// 创建博士后需求管理
export function addDemand(data?: any) {
  return request({
    url: '/project/postdoc/demand/create',
    method: 'POST',
    data,
  })
}

// 更新博士后需求管理
export const updateDemand = (data: any) => {
  return request({
    url: '/project/postdoc/demand/update',
    method: 'PUT',
    data,
  })
}

// 导出博士后需求管理 Excel
export function getDemandExport(params: any) {
  return request({
    url: '/project/postdoc/demand/export-excel',
    method: 'GET',
    responseType: 'blob',
    params,
  })
}

// 删除博士后需求管理
export const deletePatent = (id: number) => {
  return request({
    url: `/project/postdoc/demand/delete?id=${id}`,
    method: 'DELETE',
  })
}

// 获得博士后人员管理分页
export function getPersonnelList(params?: any) {
  return request({
    url: '/project/postdoc/personnel/page',
    method: 'GET',
    params,
  })
}
// 获得博士后人员列表
export function getPersonnelNoPage(params?: any) {
  return request({
    url: '/project/postdoc/personnel/list',
    method: 'GET',
    params,
  })
}
// 创建博士后人员管理
export function addPersonnel(data?: any) {
  return request({
    url: '/project/postdoc/personnel/create',
    method: 'POST',
    data,
  })
}

// 获得博士后人员管理
export function getPersonnelInfo(params?: any) {
  return request({
    url: '/project/postdoc/personnel/get',
    method: 'GET',
    params,
  })
}

// 更新博士后人员管理
export const updatePersonnel = (data: any) => {
  return request({
    url: '/project/postdoc/personnel/update',
    method: 'PUT',
    data,
  })
}

// 更新博士后人员管理工作状态
export const updatePersonnelWork = (params: any) => {
  return request({
    url: '/project/postdoc/personnel/update-work-status',
    method: 'PUT',
    params,
  })
}

// 导出博士后人员管理 Excel
export function getPersonnelExport(params: any) {
  return request({
    url: '/project/postdoc/personnel/export-excel',
    method: 'GET',
    responseType: 'blob',
    params,
  })
}

// 删除博士后人员管理
export const deletePersonnel = (id: number) => {
  return request({
    url: `/project/postdoc/personnel/delete?id=${id}`,
    method: 'DELETE',
  })
}

// 创建博士后填报季报
export function addQuarterly(data?: any) {
  return request({
    url: '/project/postdoc/quarterly-report/create',
    method: 'POST',
    data,
  })
}

// 获得博士后填报季报
export function getQuarterlyInfo(params?: any) {
  return request({
    url: '/project/postdoc/quarterly-report/get',
    method: 'GET',
    params,
  })
}

// 获得博士后填报季报分页
export function getQuarterlyList(params?: any) {
  return request({
    url: '/project/postdoc/quarterly-report/page',
    method: 'GET',
    params,
  })
}

// 更新博士后填报季报
export const updateQuarterly = (data: any) => {
  return request({
    url: '/project/postdoc/quarterly-report/update',
    method: 'PUT',
    data,
  })
}

// 获得博士后成果及荣誉分页

export function getAchievement(params?: any) {
  return request({
    url: '/project/postdoc/achievement/page',
    method: 'GET',
    params,
  })
}
// 获得博士后成果及荣誉
export function getAchievementInfo(params?: any) {
  return request({
    url: '/project/postdoc/achievement/get',
    method: 'GET',
    params,
  })
}

// 创建博士后成果及荣誉
export function addAchievement(data?: any) {
  return request({
    url: '/project/postdoc/achievement/create',
    method: 'POST',
    data,
  })
}

// 更新博士后成果及荣誉
export const updateAchievement = (data: any) => {
  return request({
    url: '/project/postdoc/achievement/update',
    method: 'PUT',
    data,
  })
}

// 导出博士后成果及荣誉 Excel
export function getDemandAchievement(params: any) {
  return request({
    url: '/project/postdoc/achievement/export-excel',
    method: 'GET',
    responseType: 'blob',
    params,
  })
}

// 删除博士后成果及荣誉
export const deletedAchievement = (id: number) => {
  return request({
    url: `/project/postdoc/achievement/delete?id=${id}`,
    method: 'DELETE',
  })
}
